<template>
  <div>
    <el-col :span="24">

      <el-row>
        <div align="center"><h1>发送个人工作提醒</h1></div>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="4"><div class="grid-content">
          </div>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="2"><div class="grid-content">&nbsp;</div></el-col>
        <el-col :span="20"><div class="grid-content">
          </div>
          <h3>选择要发送的用户（手机号或域账号,逗号相隔）</h3>
          <!-- <h4>选择要发送的用户:</h4></div> -->
          <el-input v-model="user"  type="textarea"  rows="1" placeholder="例子：binbin.zhang,13372542902" style="width:80%" />

         <h3>如发送异常，提醒人（写自己的手机号）:</h3>
          <el-input v-model="whoareyou"  type="textarea"  rows="1" placeholder="13372542902" style="width:80%" />

         <h3>请输发送的内容:</h3>
          <el-input v-model="val"  type="textarea"  rows="3" placeholder="例子：通知,xxxx" style="width:80%" />



          <!-- <el-input  v-model="image" placeholder="请输入内容" /> -->
          <br><br><br><br>
          <el-button type="primary" style="width:20%" icon="el-icon-top" @click="sumbit">提交发送</el-button>

          <br><br>

          <div v-show="play" v-highlight>
            <pre><code class="javascript" v-html="message2" /></pre>
          </div>
          <!-- <el-button type="primary" style="width:20%" icon="el-icon-top" @click="copyText" v-show="play">复制</el-button> -->
        </el-col>
      </el-row>



    </el-col>
  </div>

</template>

<script>
import { encryption } from '@/api/query'
//generatepassword
export default {
  data() {
    return {
         user:'',
         val:'',
         whoareyou : '',
      message2: '',
      play: false,
      // msg:'加载中',
          }
  },
  created() {
    // this.MopoPodList()
  },

  methods: {
    sumbit() {
      this.play = true
      encryption({ 'phones': this.user, 'val': this.val, 'whoareyou':this.whoareyou  }).then(response => {
        console.log(response.data)
        // console.log(response.data.length)
        // var val1 = '0'
        // var val1 = ''

        // for (var i = 0; i < response.data.length; i++) {
        //   console.log(response.data[i]) //取到加密前，加密后
        // }
        // console.log(response.value)
        this.message2 = response.data

        // this.value= response.data.podname
      })
    },

//
// copyText(){
//   var input = document.createElement("input");   // js创建一个input输入框
//   input.value = this.message2;  // 将需要复制的文本赋值到创建的input输入框中
//   document.body.appendChild(input);    // 将输入框暂时创建到实例里面
//   input.select();   // 选中输入框中的内容
//   document.execCommand("Copy");   // 执行复制操作
//   document.body.removeChild(input); // 最后删除实例中临时创建的input输入框，完成复制操作
//   this.$message({
//             message: '复制完成',
//             type: 'success',
//             offset: 80,
//           });
// },

  }
}
</script>

<style scoped>
.el-col {
  min-height: 1px
}
</style>
